package com.jet.chat.db;

import com.jet.chat.exception.ChatExceptionDBService;
import com.jet.chat.service.DBQueryService;
import com.jet.chat.service.DBConnectionService;


public class ChatUsersCreate {

	public static void main(String[] args) {
		DBConnectionService dbConnectionService = new DBConnectionService("chatdb");
		try {
			dbConnectionService.createConnection();
			DBQueryService.execUPD(dbConnectionService, "create table users (id int primary key not null, username varchar(20), password varchar(20))");
			DBQueryService.execUPD(dbConnectionService, "insert into users (id, username, password) values (1, 'alisa', 'tao')");
			DBQueryService.execUPD(dbConnectionService, "insert into users (id, username, password) values (2, '1', '1')");
			DBQueryService.execUPD(dbConnectionService, "insert into users (id, username, password) values (3, '2', '2')");
			DBQueryService.execUPD(dbConnectionService, "insert into users (id, username, password) values (4, '3', '3')");
			DBQueryService.execUPD(dbConnectionService, "insert into users (id, username, password) values (5, '4', '4')");
			DBQueryService.execUPD(dbConnectionService, "insert into users (id, username, password) values (6, '5', '5')");
			DBQueryService.execUPD(dbConnectionService, "insert into users (id, username, password) values (7, 'marina', 'marina')");
			DBQueryService.execUPD(dbConnectionService, "insert into users (id, username, password) values (8, 'gerunn', 'gerunn')");
			DBQueryService.execUPD(dbConnectionService, "insert into users (id, username, password) values (9, 'asd', 'asd')");
			DBQueryService.execUPD(dbConnectionService, "insert into users (id, username, password) values (10, 'zxc', 'zxc')");
			dbConnectionService.shutdown();
		} catch (ChatExceptionDBService e) {
			e.printStackTrace();
		}
	}

}
